#define _CRT_SECURE_NO_WARNINGS	

#include<stdio.h>

int main()
{
    int a, b, c, d;
    int n, m;
    scanf("%d%d%d%d", &a, &b, &c, &d);
    scanf("%d,%d", &n, &m);
    int count = 0;
    for (int i = n; i <= m; i++)
    {
        for (int j = n; j <= m; j++)
        {
            if ((d - a * i - b * j) % c == 0 && (d - a * i - b * j) / c <= m && (d - a * i - b * j) / c >= n)
                count++;
        }
    }
    printf("%d", count);
    return 0;
}